package com.guigu.chenjiajun.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.chenjiajun.service.ProductionQueryService;
import com.guigu.common.mapper.MApplyMapper;
import com.guigu.common.pojo.MApply;
import com.guigu.common.vo.SearchVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ProductionQueryServiceImpl implements ProductionQueryService {
    @Resource
    private MApplyMapper mapper;

    @Override
    public SearchVo<MApply> queryProduction(SearchVo searchVo) {
        PageHelper.startPage(searchVo.getPageNumber(),searchVo.getPageSize());
        PageInfo p=new PageInfo(this.mapper.queryProduction(searchVo));
        searchVo.setRows(p.getList());
        searchVo.setTotal(p.getTotal());
        return searchVo;
    }
}
